<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <th:block th:include="include :: header('货运订单列表')" />
  <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
<div class="container-div">
  <div class="row">
<!--    <div class="col-sm-10 search-collapse">-->
<!--      <form id="formId">-->
<!--        <div class="select-list">-->
<!--          <ul>-->
<!--            <li>-->
<!--              <label>提验人：</label>-->
<!--              <input type="text" name="vehicleInspector"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>业务员：</label>-->
<!--              <input type="text" name="userName"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>车型：</label>-->
<!--              <input type="text" name="vehicleModel"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>车架号：</label>-->
<!--              <input type="text" name="vin"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>委托人：</label>-->
<!--              <input type="text" name="client"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>委托人电话：</label>-->
<!--              <input type="number" name="clientPhone"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>起始地：</label>-->
<!--              <input type="text" name="origin"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>目的地：</label>-->
<!--              <input type="text" name="dest"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>接车人电话：</label>-->
<!--              <input type="number" name="receiverPhone"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>运费金额：</label>-->
<!--              <input type="number" name="freightAmount" min="0"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>驾驶员：</label>-->
<!--              <input type="text" name="transporter"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>驾驶员电话：</label>-->
<!--              <input type="number" name="transporterPhone"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>车牌号：</label>-->
<!--              <input type="text" name="plateNumber"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>支付方式：</label>-->
<!--              <select name="payType" th:with="type=${@dict.getType('pay_type')}">-->
<!--                <option value="">所有</option>-->
<!--                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--              </select>-->
<!--            </li>-->
<!--            <li>-->
<!--              <label>订单状态：</label>-->
<!--              <select name="orderType" th:with="type=${@dict.getType('order_type')}">-->
<!--                <option value="">所有</option>-->
<!--                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--              </select>-->
<!--            </li>-->
<!--            <li class="select-time">-->
<!--              <label>操作时间： </label>-->
<!--              <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>-->
<!--              <span>-</span>-->
<!--              <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>-->
<!--            </li>-->
<!--            <li>-->
<!--              <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
<!--              <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
<!--            </li>-->
<!--          </ul>-->
<!--        </div>-->
<!--      </form>-->
<!--    </div>-->

    <div class="btn-group-sm" id="toolbar" role="group">
      <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:order:remove">
        <i class="fa fa-remove"></i> 彻底删除
      </a>
    </div>
    <div class="col-sm-12 select-table table-striped" style=" white-space: nowrap; overflow: hidden; overflow-x: scroll; -webkit-backface-visibility: hidden; -webkit-overflow-scrolling: touch;">
      <table id="bootstrap-table"></table>
    </div>
  </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-select-js" />
<script th:inline="javascript">
  var updateFlag = [[${@permission.hasPermi('system:order:update')}]];
  var removeFlag = [[${@permission.hasPermi('system:order:remove')}]];
  var detailFlag = [[${@permission.hasPermi('system:order:detail')}]];
  var datasPay = [[${@dict.getType('pay_type')}]];
  var datasType = [[${@dict.getType('order_type')}]];
  var datasDelete = [[${@dict.getType('is_delete')}]];
  var prefix = ctx + "system/order";
  $(function() {
    var options = {
      url: prefix + "/deleteList",
      createUrl: prefix + "/add",
      updateUrl: prefix + "/update",
      removeUrl: prefix + "/remove",
      exportUrl: prefix + "/export",
      detailUrl: prefix + "/detail/{id}",
      modalName: "已删除订单",
      columns: [{
        checkbox: true
      },
        {
          field: 'id',
          title: '主键',
          visible: false
        },
        {
          field: 'createUser',
          title: '建单人'
        },
        {
          field: 'vehicleInspector',
          title: '提验人'
        },
        {
          field: 'inspectionFee',
          title: '提验费'
        },
        {
          field: 'agencyFee',
          title: '中介费'
        },
        {
          field: 'userName',
          title: '业务员'
        },
        {
          field: 'vehicleModel',
          title: '车型'
        },
        {
          field: 'vin',
          title: '车架号'
        },
        {
          field: 'client',
          title: '委托人'
        },
        // {
        //     field: 'clientPhone',
        //     title: '委托人电话'
        // },
        {
          field: 'origin',
          title: '起始地'
        },
        {
          field: 'dest',
          title: '目的地'
        },
        // {
        //     field: 'receiver',
        //     title: '接收人'
        // },
        {
          field: 'receiverPhone',
          title: '接车人电话'
        },
        {
          field: 'payType',
          title: '支付方式',
          align: 'center',
          formatter: function(value, row, index) {
            return $.table.selectDictLabel(datasPay, value);
          }
        },
        {
          field: 'freightAmount',
          title: '运费金额'
        },
        {
          field: 'paidAmount',
          title: '已付金额'
        },
        {
          field: 'orderType',
          title: '订单状态',
          align: 'center',
          formatter: function(value, row, index) {
            return $.table.selectDictLabel(datasType, value);
          }
        },
        {
          field: 'notes',
          title: '备注'
        },
        {
          field: 'createTime',
          title: '建单时间'
        },
        {
          field: 'updateTime',
          title: '发运时间'
        },
        {
          field: 'isDelete',
          title: '数据状态',
          align: 'center',
          formatter: function(value, row, index) {
            return $.table.selectDictLabel(datasDelete, value);
          }
        },
        {
          title: '操作',
          align: 'center',
          formatter: function(value, row, index) {
            var actions = [];
            actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.id + '\')"><i class="fa fa-search"></i>详情</a>');
            actions.push('<a class="btn btn-success btn-xs ' + updateFlag + '" href="javascript:void(0)" onclick="$.operate.updateStatus(\'' + row.id + '\')"><i class="fa fa-edit"></i>恢复</a>');
            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>彻底删除</a>');
            return actions.join('');
          }
        }]
    };
    $.table.init(options);
  });
</script>
</body>
</html>